package com.originskyseed.platform.course.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.course.model.CourseStudyRecord;

/**
 * 课程学习记录表Mapper类（OSI_COURSE_STUDY_RECORD）
 *
 * @author Tangwanghui
 */
public interface CourseStudyRecordMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(CourseStudyRecord record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(CourseStudyRecord record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(CourseStudyRecord record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(CourseStudyRecord record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public CourseStudyRecord selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param courseId
	 * @param creatorId
	 * @return
	 * @throws Exception
	 */
	public CourseStudyRecord selectIsStudy(@Param("courseId") String courseId, @Param("creatorId") String creatorId, @Param("status") Integer status, @Param("taskId") String taskId) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<CourseStudyRecord> selectList(CourseStudyRecord record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CourseStudyRecord> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 分页查询学习情况
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CourseStudyRecord> selectStudySituationByPage(Map<String, Object> params) throws Exception;
}
